<template>
	<scroll-view scroll-y=true class="list-wrapper">
		<view class="list-item" v-for="(item,index) in list" :key="index" :class="windowId==index?'active':''" @click="showWindow(item.id)">
			{{item.name}}
		</view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				windowId:0
			};
		},
		methods:{
			showWindow(e){
				this.windowId=e
				this.$emit("getWindowMessage",this.windowId)
			}
		},
		props:{
			list:{
				type:Array
			}
		}
	}
</script>

<style scoped>
	.list-item{
		width: 200rpx;
		height: 50rpx;
		background-color: #fff;
		text-align: center;
		padding: 20rpx 0;
		color: #8b8b8b;
	}
	.list-item.active{
		background-color: #f2f2f2;
		color: #000000;
	}
	.list-wrapper{
		height: 100%;
		width: 200rpx;
		background-color: #fff;
	}
</style>
